package com.litblue.artwork.controller;


import com.litblue.artwork.service.ArtworkService;
import com.litblue.starter.core.AjaxResult;
import com.litblue.starter.pojo.artwork.domain.LitArtworkUser;
import com.litblue.starter.pojo.artwork.dto.LitArtworkInfoDto;
import com.litblue.starter.pojo.artwork.dto.LitArtworkUserDto;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/art/workInfo")
@RequiredArgsConstructor(onConstructor_ = @Autowired)
public class ArtworkController {

    private final ArtworkService artworkService;

    @PostMapping("saveArtWorkInfo")
    AjaxResult saveArtWorkInfo(@RequestBody LitArtworkInfoDto litArtworkInfoDto){

       return artworkService.saveArtWorkInfo(litArtworkInfoDto);
    }
//    http://localhost:8080/art/workInfo/clickLikeArtInfo
    @PostMapping("clickLikeArtInfo")
    AjaxResult clickLikeArtInfo(@RequestBody LitArtworkUserDto litArtworkUserDto){
        return artworkService.clickLikeArtInfo(litArtworkUserDto);
    }
//    http://localhost:8080/art/workInfo/getLitArtworkInfoVo
    @GetMapping("getLitArtworkInfoVo")
    AjaxResult getLitArtworkInfoVo(Long artworkId){
      return   artworkService.getLitArtworkInfoVo(artworkId);
    }
}
